#include "messages.h"


#if defined(GENERIC)
ostream &RoutingMessage::Print(ostream &os) const
{
  os << "RoutingMessage()";
  return os;
}
#endif


#if defined(LINKSTATE)

ostream &RoutingMessage::Print(ostream &os) const
{
  return os;
}

RoutingMessage::RoutingMessage()
{}


RoutingMessage::RoutingMessage(const RoutingMessage &rhs)
{}

#endif


#if defined(DISTANCEVECTOR)

ostream &RoutingMessage::Print(ostream &os)
{
  map<unsigned int, double>::iterator messageIT;

  for (messageIT = m_mapMessage.begin(); messageIT != m_mapMessage.end(); messageIT++)
  {
    os << (*messageIT).first << " => " << (*messageIT).second << endl;
  }
  return os;
}

void RoutingMessage::PrintRoutingMessage()
{
  map<unsigned int, double>::iterator messageIT;
  cout << "Source: " << m_uintSource << endl;
  for (messageIT = m_mapMessage.begin(); messageIT != m_mapMessage.end(); messageIT++)
  {
    cout << "\t" << (*messageIT).first << " => " << (*messageIT).second << endl;
  }
}

RoutingMessage::RoutingMessage(map<unsigned int, double> mapMessage, unsigned int uintSource)
{
  m_mapMessage = mapMessage;
  m_uintSource = uintSource;
}

RoutingMessage::RoutingMessage()
{}


RoutingMessage::RoutingMessage(const RoutingMessage &rhs)
{}


#endif

